package com.ww.java.generic;

public class ClassGenericDemo {
    public static void main(String[] args) {
        Generic<Integer> genericInt = new Generic<>(123456);
        Generic<String> genericString = new Generic<>("key_value");
        System.out.println("泛型测试" + genericInt.getKey());
        System.out.println("泛型测试" + genericString.getKey());
    }
}

class Generic<T> {
    private T key;

    public Generic(T key) {
        this.key = key;
    }

    public T getKey() {
        return key;
    }
}
